package com.teaphy.coroutinecrawler.flow.operators

import kotlinx.coroutines.*
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.*

fun main() = runBlocking{
    flow {
        println("flow currentScope: ${currentCoroutineContext()}")
        for (value in 0..10) {
            emit(value)
            delay(100)
        }
    }.conflate()
        .collect {
            println("collect currentScope: ${currentCoroutineContext()}")
            println("buffer : $it")
            delay(400)
        }
}